package practice;

import java.util.Scanner;

public class practice004 {
	private static Scanner sc;

	// 12个球称三次 知道那个轻或重
	public static void main(String[] args) {
		int d = 0;
		char c;
		System.out.println("L=(1 2 3 4 )   (5 6 7 8 )=R\n");
		c = get1();
		if (c == 'L') {
			System.out.println("L=(1 2 5 6 )   ( 3 7 9 10 )=R\n");
			c = get1();
			if (c == 'L') {
				System.out.println("L=( 1 )  ( 2 )=R\n ");
				c = get1();
				if (c == 'L')
					d = 1;
				else if (c == 'R')
					d = 2;
				else
					d = -7;
			} else if (c == 'R') {
				System.out.println("L=( 5 )  ( 6 )=R\n");
				c = get1();
				if (c == 'L')
					d = 4;
				else if (c == 'R')
					d = 13;
				else
					d = -8;
			}
		} else if (c == 'R') {
			System.out.println("L=(1 2 5 6 )   (3 7 9 10 )=R\n");
			c = get1();
			if (c == 'L') {
				System.out.println("L=( 5 )  (  6 )=R\n");
				c = get1();
				if (c == 'L')
					d = 5;
				else if (c == 'R')
					d = 6;
				else
					d = -3;
			} else if (c == 'R') {
				System.out.println("L=( 1 )   ( 2 )=R\n");
				c = get1();
				if (c == 'L')
					d = -2;
				else if (c == 'R')
					d = -1;
				else
					d = 7;
			} else {
				System.out.println("L=( 4 )   ( 9 )=R\n");
				c = get1();
				if (c == 'L')
					d = 13;
				else if (c == 'R')
					d = -4;
				else
					d = 8;
			}
		} else {
			System.out.println("L=( 9 10 1 )   (11 2 3 )=R\n");
			c = get1();
			switch (c) {
			case 'L': {
				System.out.println("L=( 9 ) ( 10 )=R\n");
				switch (c = get1()) {
				case 'L':
					d = 9;
					break;
				case 'R':
					d = 10;
					break;
				default:
					d = -11;
				}

				break;
			}
			case 'R': {
				System.out.println("L=( 9 ) ( 10 )=R\n");
				switch (c = get1()) {
				case 'L':
					d = -10;
					break;
				case 'R':
					d = -9;
					break;
				default:
					d = 11;
				}
				break;
			}

			default: {
				System.out.println("L=( 1 ) ( 12 )=R\n");
				switch (c = get1()) {
				case 'L':
					d = -12;
					break;
				case 'R':
					d = 12;
					break;
				default:
					d = 13;
				}
			}
			}
		}

		if (d == 13) {
			System.out.println("input error !\n");
		} else if (d < 0) {
			System.out.println(String.format("No.%d Light \n", -d));
		} else {
			System.out.println(String.format("No.%d Heavy \n", d));
		}

		// c=getchar();
		// c=getchar();
		// System.out.println("\n\n");

	}

	public static char get1() {
		char c = ' ';
		System.out.println("which heavy? L(left)|E(equal)|R(right)");
		while (c != 'L' && c != 'l' && c != 'r' && c != 'R' && c != 'e' && c != 'E')
			c = getchar();

		if (c > 90)
			c -= 32;
		return (c);

	}

	public static char getchar() {
		sc = new Scanner(System.in);
		char input = sc.next().charAt(0);
		return input;
	}
}
